import { AfterViewInit, Component, ElementRef, OnInit, TemplateRef, ViewChild, ViewContainerRef } from '@angular/core';

@Component({
  selector: 'kt-tpl-container',
  templateUrl: './tpl-container.component.html',
  styleUrls: ['./tpl-container.component.less'],
})
export class TplContainerComponent implements OnInit, AfterViewInit {
  @ViewChild('firstTpl', { read: TemplateRef }) readonly firstTpl: TemplateRef<any>;;
  @ViewChild('box') readonly boxEl:ElementRef;
  @ViewChild('firstContainer', {read:ViewContainerRef}) readonly firstContainer:ViewContainerRef;
  
  constructor() {}

  ngOnInit(): void {}

  ngAfterViewInit(): void {
    console.log(this.firstTpl);
    console.log(this.boxEl);
    console.log(this.firstContainer)
    this.firstContainer.createEmbeddedView(this.firstTpl);;
  }
}
